import Vue from 'vue'
import MuseUI from 'muse-ui';
import 'muse-ui/dist/muse-ui.css';
Vue.use(MuseUI);
import App from './App.vue'
import router from './router/index'
import store from './store/index'
import utils from './static/js/utils'
import './static/js/filter'
import { JSEncrypt } from 'jsencrypt'

// import VuePageStack from 'vue-page-stack';

import NutUI from '@nutui/nutui';
import 'amfe-flexible';
import '@nutui/nutui/dist/nutui.css';
// import Cookies from 'js-cookie'
// console.log(Cookies)
NutUI.install(Vue)
// 引入折线图等组件
let echarts = require('echarts/lib/echarts')
require('echarts/lib/chart/line')
require('echarts/lib/chart/bar')
require('echarts/lib/chart/pie')
// 引入提示框和title组件，图例
require('echarts/lib/component/tooltip')
require('echarts/lib/component/title')
require('echarts/lib/component/legend')
Vue.prototype.$echarts = echarts;

// Vue.prototype.Cookies =Cookies;

import http from '@/service/http'
import axios from '@/service/axios'
import './static/style/nomal.css'// 初始化样式

require('swiper/dist/css/swiper.css')


import 'swiper/dist/css/swiper.min.css';
import Swiper from "swiper/"
Vue.prototype.Swiper = Swiper;
import {
  Swipe,
  SwipeItem
} from 'vant';
Vue.use(Swipe).use(SwipeItem);
import vueg from 'vueg'
// import Router from 'vue-router'

let Options = {
  duration: 0.5,
  enter: 'fadeInRight',
  leave: 'fadeInLeft',
  disableAtSameDepths: false,
  shadow: false,
  map: {
    'report': {
      enter: ['reportList']
    },
    'mine': {
      disable: ['report']
    },
    'reportContent': {
      disable: ['reportList']
    }
  }
}
Vue.use(vueg, router, Options) // 传入实例化后的router, Options为可选的插件配置
// Vue.use(VuePageStack, { router });
const plugins = [utils]; // 插件列表
plugins.map(plg => Vue.use(plg)); // 引入插件
Vue.config.productionTip = false;
Vue.prototype.axios = axios;
Object.assign(Vue.prototype, { $http: http });


// /* RSA加密 */
// Vue.prototype.$setRSA = (password, publicKey) =>{
//     let encrypt = new JSEncrypt()
//     encrypt.setPublicKey(publicKey)
//     return encrypt.encrypt(password)
// }
// Vue.prototype.$getRSA = (rsa ,priKey)=>{
//     let decrypt = new JSEncrypt()
//     decrypt.setPrivateKey(priKey)
//     return decrypt.decrypt(rsa)
// }

import Toast from "muse-ui-toast";
Vue.use(Toast);

import 'muse-ui-message/dist/muse-ui-message.css';
import Message from 'muse-ui-message';
Vue.use(Message);

import 'muse-ui-progress/dist/muse-ui-progress.css';
import NProgress from 'muse-ui-progress';
Vue.use(NProgress);

NProgress.config({
  zIndex: 99999999,          // progress z-index
  top: 0,                // position fixed top
  speed: 300,            // progress speed
  color: '#eb4d44',      // color
  size: 3,               // progress size
  className: ''          // progress custom class
})


new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')



